package com.ssmp.exciption;

import com.ssmp.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author newThread
 * @className ProjectExceptionAdvice
 * @date 2022/2/10 9:12
 */
@RestControllerAdvice
public class ProjectExceptionAdvice {
    @ExceptionHandler(Exception.class)
    public R doOtherException(Exception ex){
        //记录日志
        //发送消息给运维
        //发送邮件给开发人员，ex对象发送给开发人员
        return new R("系统错误，请稍后再试");
    }
}
